<?php
	header("Content-type: application/vnd.ms-excel");
	header('Content-Disposition: attachment;  filename="organizaciones.csv";');
	ini_set('include_path', dirname(__FILE__));
	require_once(get_include_path().'/libraries/load.php');
	$o = OrganizacionesManager::GetForXml();
	for($i = 0; $i < count($o); $i ++){
		if($i == 0){
			foreach ($o[$i] as $key => $value)
					echo $key.';';
			echo PHP_EOL ;
		}
				
		foreach ($o[$i] as $key => $value)
				echo str_replace(";",",",utf8_decode($value) ).';';
		echo PHP_EOL;
	}
?>